/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.modules.sys.entity.Office;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 计费明细Entity
 * @author weisong
 * @version 2017-09-22
 */
public class Detail extends DataEntity<Detail> {
	
	private static final long serialVersionUID = 1L;
	public static final int updateStatus = 1;		//已结算
	public static final int updateStatus1 = 0;		//未结算
	private Office logistics;		// 物流机构
	private Integer status;		// 状态
	private Consignor clearUnit;		// 结算方
	private Agreement feeAgreement;		// 计费协议
	private Type feeType;		// 费用类型
	private Date busyDate;		// 业务日期
	private Double payMoney;		// 计费金额
	private Double clearingMoney;		// 调整金额
	private String idNumber;		// 用于关联到数据源明细子表中具体某一行
	private String codes;		// 数据源的所有表头
	private String feeData;		// 数据源
	private String updateReason;		// 调整金额的调整原因
	private Date updateClearingDate;		// 调整金额的调整时间
	private String caculateDesc;		// 计算描述 如：重量*单价*费率
	private String caculateValue;		// 计算数值 如：1+2*3/5

	//非数据库字段，查询使用
	private Date startDate;		// 生效时间
	private Date endDate;		// 有效期
	private String updateId;	//更新人id
	private String updateName;	//更新人姓名
	public Detail() {
		super();
	}

	public Detail(String id){
		super(id);
	}

	@ExcelField(title="物流机构", fieldType=Office.class, value="logistics.name", align=2, sort=6)
	public Office getLogistics() {
		return logistics;
	}

	public void setLogistics(Office logistics) {
		this.logistics = logistics;
	}
	
	@NotNull(message="状态不能为空")
	@ExcelField(title="状态", dictType="detail_status", align=2, sort=7)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@NotNull(message="结算方不能为空")
	@ExcelField(title="结算方", fieldType=Consignor.class, value="", align=2, sort=8)
	public Consignor getClearUnit() {
		return clearUnit;
	}

	public void setClearUnit(Consignor clearUnit) {
		this.clearUnit = clearUnit;
	}
	
	@NotNull(message="计费协议不能为空")
	@ExcelField(title="计费协议", fieldType=Agreement.class, value="", align=2, sort=9)
	public Agreement getFeeAgreement() {
		return feeAgreement;
	}

	public void setFeeAgreement(Agreement feeAgreement) {
		this.feeAgreement = feeAgreement;
	}
	
	@NotNull(message="费用类型不能为空")
	@ExcelField(title="费用类型", fieldType=Type.class, value="", align=2, sort=10)
	public Type getFeeType() {
		return feeType;
	}

	public void setFeeType(Type feeType) {
		this.feeType = feeType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="业务日期不能为空")
	@ExcelField(title="业务日期", align=2, sort=11)
	public Date getBusyDate() {
		return busyDate;
	}

	public void setBusyDate(Date busyDate) {
		this.busyDate = busyDate;
	}
	
	@NotNull(message="计费金额不能为空")
	@ExcelField(title="计费金额", align=2, sort=12)
	public Double getPayMoney() {
		return payMoney;
	}

	public void setPayMoney(Double payMoney) {
		this.payMoney = payMoney;
	}

	@ExcelField(title="调整金额", align=2, sort=13)
	public Double getClearingMoney() {
		return clearingMoney;
	}

	public void setClearingMoney(Double clearingMoney) {
		this.clearingMoney = clearingMoney;
	}
	
	@ExcelField(title="用于关联到数据源明细子表中具体某一行", align=2, sort=14)
	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}
	
	@ExcelField(title="数据源的所有表头", align=2, sort=15)
	public String getCodes() {
		return codes;
	}

	public void setCodes(String codes) {
		this.codes = codes;
	}
	
	@ExcelField(title="数据源", align=2, sort=16)
	public String getFeeData() {
		return feeData;
	}

	public void setFeeData(String feeData) {
		this.feeData = feeData;
	}
	
	@ExcelField(title="调整金额的调整原因", align=2, sort=17)
	public String getUpdateReason() {
		return updateReason;
	}

	public void setUpdateReason(String updateReason) {
		this.updateReason = updateReason;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="调整金额的调整时间", align=2, sort=18)
	public Date getUpdateClearingDate() {
		return updateClearingDate;
	}

	public void setUpdateClearingDate(Date updateClearingDate) {
		this.updateClearingDate = updateClearingDate;
	}
	
	@ExcelField(title="计算描述 如：重量*单价*费率", align=2, sort=19)
	public String getCaculateDesc() {
		return caculateDesc;
	}

	public void setCaculateDesc(String caculateDesc) {
		this.caculateDesc = caculateDesc;
	}
	
	@ExcelField(title="计算数值 如：1+2*3/5", align=2, sort=20)
	public String getCaculateValue() {
		return caculateValue;
	}

	public void setCaculateValue(String caculateValue) {
		this.caculateValue = caculateValue;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getUpdateId() {
		return updateId;
	}

	public void setUpdateId(String updateId) {
		this.updateId = updateId;
	}

	public String getUpdateName() {
		return updateName;
	}

	public void setUpdateName(String updateName) {
		this.updateName = updateName;
	}
}